from django.contrib.auth.models import AbstractUser
from django.db import models

# Create your models here.
class User(AbstractUser):
    username = models.CharField(verbose_name="用户名", max_length=11, unique=True)
    mobile = models.CharField(verbose_name="手机号", max_length=11, unique=True)
    password = models.CharField(verbose_name="密码", max_length=200)
    image = models.CharField(verbose_name="头像链接", max_length=200, null=True, blank=True)
    avater = models.ImageField(upload_to='avater', verbose_name='用户头像', null=True, blank=True,
                               help_text="头像大小规格：128*128")

    class Meta:
        db_table = 'taobao_users'
        verbose_name = '淘宝用户'
        verbose_name_plural = verbose_name

    def __str__(self):
        return "%s" % self.username
